Add hooks for a script to update kernel configuration after tree has been
authorIan Campbell <ian.campbell@xensource.com>
Mon, 9 Jul 2007 10:29:39 +0000 (11:29 +0100)
committerIan Campbell <ian.campbell@xensource.com>
Mon, 9 Jul 2007 10:29:39 +0000 (11:29 +0100)
prepared. This is to support upstream sources which do not enable Xen in their
default configurations.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
buildconfigs/enable-xen-config [new file with mode: 0644]
buildconfigs/mk.linux-2.6-paravirt
buildconfigs/mk.linux-2.6-xen

diff --git a/buildconfigs/enable-xen-config b/buildconfigs/enable-xen-config
new file mode 100644 (file)
index 0000000..b427a12
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -ex
+
+if [ $# -ne 1 ] ; then
+       echo "Usage $(basename $0) <config-file>" 1>&2
+       exit 1
+fi
+
+CONFIG=$1
+
+setopt()
+{
+       OPTION=$1
+       VALUE=$2
+
+       # First remove any existing instances of this option
+       sed -e "s/^# ${OPTION} is not set$//g ; s/^^{OPTION}=.$//g" -i "${CONFIG}"
+
+       # Then append the new value
+       case ${VALUE} in
+           y|m) echo "${OPTION}=${VALUE}" >> "${CONFIG}" ;;
+           n)   echo "# ${OPTION} is not set" >> "${CONFIG}" ;;
+           *)   echo "Invalid value ${VALUE} for ${OPTION}" 1>&2 ; exit 1 ;;
+       esac
+}
+
+setopt CONFIG_PARAVIRT y
+setopt CONFIG_XEN y
+setopt CONFIG_VMI y
+setopt CONFIG_LGUEST n
+setopt CONFIG_XEN_BLKDEV_FRONTEND y
+setopt CONFIG_XEN_NETDEV_FRONTEND y
+setopt CONFIG_HVC_XEN y
+
+exit 0
index 4ff8d7b99b41c611d53f8ed3de7ff4d7e96f50e0..a48da1760085a9ce6df74b1db3bfccda85fcadf4 100644 (file)
@@ -8,6 +8,8 @@ IMAGE_TARGET ?= vmlinux bzImage
 
 XEN_LINUX_ALLOW_INTERFACE_MISMATCH := y
 
-EXTRAVERSION ?=
+XEN_LINUX_CONFIG_UPDATE := buildconfigs/enable-xen-config
+
+EXTRAVERSION ?= -paravirt
 
 include buildconfigs/mk.linux-2.6-xen
index a0c69163492320a1de9559c7932933e448e3d99a..4fd195b39797714bb7096a2672fb620c4db5c280 100644 (file)
@@ -74,6 +74,10 @@ $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
        else \
           echo "No configuration method found for this kernel" ; \
        fi
+ifneq ($(XEN_LINUX_CONFIG_UPDATE),)
+       echo "Updating $(CONFIG_FILE) using $(XEN_LINUX_CONFIG_UPDATE)"
+       sh $(XEN_LINUX_CONFIG_UPDATE) $(CONFIG_FILE)
+endif
 ifeq ($(XEN_TARGET_ARCH),x86_32)
 ifeq ($(pae),y)
        sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)